setTimeout(() => {
  process.nextTick(() => console.log('nextTick1'))

  setTimeout(() => {
    console.log('setTimout1')

    process.nextTick(() => {
      console.log('nextTick2')
      setImmediate(() => console.log('setImmediate1'))
      process.nextTick(() => console.log('nextTick3'))
    })
    setImmediate(() => console.log('setImmediate2'))
    process.nextTick(() => console.log('nextTick4'))

    console.log('sync2')
    
    setTimeout(() => console.log('setTimout2'), 0)
  }, 0)

  console.log('sync1')
}, 0) 